package main

import (
	"fmt"
	"net/url"
	// "net/http"
	// "net/url"
)

// import "github.com/gin-gonic/gin"

//import "log"

type user struct {
	Username string
	Password string
}

func main() {
	fmt.Println("Gin")
	// r := gin.Default()

	//ssk疑问
	var s string
	var v url.Values
	s = "Hello "
	s = s + "world"

	bolb := "Bob"
	v.Add(bolb, "yeah")
	fmt.Printf("%s\n", s)
	fmt.Println(v)

	/*
		r.GET("/", func(ctx *gin.Context) {
			ctx.JSON(200, gin.H{
				"status":  "Success",
				"message": "Hello gin",
			})
		})
		r.Run(":9090")
	*/

	/*
		//2.Go语言之Gin之数据绑定
		r.POST("/bind", func(ctx *gin.Context) {
			var user1 user
			ctx.BindJSON(&user1)
			log.Println(user1.Username, user1.Password)
		})
		r.Run(":9090")
	*/

	//3.Go语言之Gin之动态路由
	//r :=gin.Default()
	/*
		r.GET("/user/:name", func(ctx *gin.Context) {
			value := ctx.Param("name")
			ctx.String(http.StatusOK, "hello,%s", value)
		})
		r.Run(":9090")
	*/
}
